package scau.filesystem.view;


import javafx.fxml.FXML;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

public class CreateContentDialogController {
	@FXML
	private TextField filenameField;
	private Stage dialogStage;
	private boolean isOkClicked=false;
	 String filename="";
	@FXML
    private void initialize() {
    }

    public void setDialogStage(Stage dialogStage) {
        this.dialogStage = dialogStage;
    }

	@FXML
	private void handleOk(){
		if(filenameField.getText()==null||filenameField.getText().length()==0){
			filenameField.setText("");	
			isOkClicked=false;
			dialogStage.close();
		}else{
			isOkClicked=true;
			filename=filenameField.getText();
			
			dialogStage.close();
		}
	}
	@FXML
	private void handleCancel(){
		isOkClicked=false;
		dialogStage.close();
	}
	public boolean isOkClicked(){	
		return isOkClicked;
	}
	public String getFileName(){
		return filename;
	}
}
